package zhongbo.javaweb.instagram;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.server.PortInUseException;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 说明：
 *
 * @author zhongboWork
 * @version 1.0
 * @since 2021-12-15 11:29
 */
@EnableConfigurationProperties
@EnableScheduling
@SpringBootApplication
@Slf4j
public class InstagramMain {
    public static void main(String[] args) {

        SpringApplication application = new SpringApplication(InstagramMain.class);
        try {
            application.run(args);
            log.info("-------- ok --------");
        } catch (Exception e) {
            if (e instanceof PortInUseException) {
                PortInUseException portInUseException = (PortInUseException) e;
                log.error("程序启动失败! 端口被占用: {}", portInUseException.getPort());
            } else {
                log.error("程序启动失败! error: ", e);
            }
        }

    }
}
